package com.maruti.otterapi.urlinfo;

import com.maruti.otterapi.Otter4JavaException;
import com.maruti.otterapi.TopsyConfig;
import com.maruti.otterapi.TopsyConstants;
import com.maruti.otterapi.TopsyInvoker;

public class URLInfo {

	private TopsyConfig topsyConfig;

	public TopsyConfig getTopsyConfig() {
		return topsyConfig;
	}

	public void setTopsyConfig(TopsyConfig topsyConfig) {
		this.topsyConfig = topsyConfig;
	}

	public URLInfoResponse urlInfo(String url) throws Otter4JavaException {
		TopsyInvoker invoker = new TopsyInvoker();
		invoker.setTopsyConfig(topsyConfig);

		URLInfoResponse response =  (URLInfoResponse) invoker.fetchData(
				TopsyConstants.urlInfoURL + url, "urlInfo");

		return response;
	}
}
